<%@page import="com.qianduo.vo.CitiesForm"%>
<%@page import="com.qianduo.vo.AccountForm"%>
<%@page import="com.qianduo.util.Global"%>
<%@page import="java.util.Map,java.util.List,java.util.Map.Entry,com.qianduo.util.Common,common.util.StringUtil"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/pages/jsp/common/head.jsp"%>
<%
	Object accountFormObj = request.getAttribute("accountForm");
	AccountForm form		= null;
	String tmpType			= "-1";
	String tmpCity			= "-1";
	if(null != accountFormObj){
		form			= (AccountForm)accountFormObj;
		tmpType			= null != form.getType() ? form.getType().toString() : "-1";
		tmpCity			= null != form.getCityID() ? form.getCityID().toString() : "-1";
	}
	currentTab	= "listAccount";
%>
<script type="text/javascript" src="${pageContext.request.contextPath}/scripts/js/extendArray.js" ></script>
<div class="wrapnme">
<!--citeLeft-->
    <%@ include file="/pages/jsp/common/left.jsp"%>
    <!--citeLeft结束-->    
    <!--sideRight-->
    <div class="sideRight">
		<!--title-->
        <div class="Right_title">
        	贷款信息添加
        </div>
        <!--title结束-->
        <!--content-->
        <div class="content">
        	<div style="color:red;">
        		<c:forEach var="error" items="${errors}" varStatus="count">
        			<div>${count.index + 1}.${error}</div>
        		</c:forEach>
        	</div>
        	<form action="<%=host%>/account.do?action=modifyAccount" method="post">
        		<input type="hidden" name="username" id="username" value="${accountForm.username}" />
	        	 <table width="100%" border="1" class="tablesorter" >
	        		<tr>
		        	 	<th>用户名:</th>
		        	 	<td>${accountForm.username}</td>
	        		</tr>
	        		<tr>
		        	 	<th>帐号类型:</th>
		        	 	<td>
		        	 		<select name="type" id="type"><option value="">请选择类型</option>
		        	 			<%
		        	 			Map<String,String> accountTypeMap	= Global.accountTypeMap;
		        	 			for(Entry<String,String> entry: accountTypeMap.entrySet()){
		        	 				String code	= entry.getKey();
		        	 				String name	= entry.getValue();
		        	 				out.print("<option value='"+code+"' "+(tmpType.equals(code) ? "selected='selected'":"")+">"+name+"</option>");
		        	 			}
		        	 			%>
		        	 		</select>
		        	 	</td>
	        		</tr>
	        		<tr>
	        			<th>分配分机号:</th>
		        	 	<td><input type="text" id="ext" name="ext" value="${accountForm.ext}" /></td>
	        		</tr>
	        		<tr>
	        			<th>是否通过审核:</th>
		        	 	<td><input type="checkbox" name="isVerify" id="isVerify" value="1" ${accountForm.isVerify == 1 ? "checked='checked'" : ""} /> </td>
	        		</tr>
	        		<tr>
	        			<th>是否实名认证:</th>
		        	 	<td><input type="checkbox" name="isCert" id="isCert" value="1" ${accountForm.isCert == 1 ? "checked='checked'" : ""} /> </td>
	        		</tr>
	        		<tr>
	        			<th>是否营业执照认证:</th>
		        	 	<td><input type="checkbox" name="isBusinessLicense" id="isBusinessLicense" value="1" ${accountForm.isBusinessLicense == 1 ? "checked='checked'" : ""} /> </td>
	        		</tr>
	        		<tr>
	        			<th>推荐星级:</th>
		        	 	<td><select name="recommendStar" id="recommendStar" >
		        	 		<option value="">请选择</option>
		        	 		<option value="5" ${accountForm.recommendStar == 5 ? "selected='selected'" : ""} >5星</option>
		        	 		<option value="4" ${accountForm.recommendStar == 4 ? "selected='selected'" : ""} >4星</option>
		        	 		<option value="3" ${accountForm.recommendStar == 3 ? "selected='selected'" : ""} >3星</option>
		        	 		<option value="2" ${accountForm.recommendStar == 2 ? "selected='selected'" : ""} >2星</option>
		        	 		<option value="1" ${accountForm.recommendStar == 1 ? "selected='selected'" : ""} >1星</option>
		        	 	</select></td>
	        		</tr>
	        		<tr>
	        			<th>所在城市:</th>
		        	 	<td>
		        	 		<select name="cityID" id="cityID">
		        	 			<option value="">请选择</option>
		        	 			<%
		        	 				Map<String,List<CitiesForm>> citiesMap	= Global.citiesMap;
		        	 				for(Entry<String,List<CitiesForm>> entry : citiesMap.entrySet()){
		        	 					List<CitiesForm> citiesList	= entry.getValue();
		        	 					for(CitiesForm cf : citiesList){
		        	 						String id			= cf.getId().toString();
		        	 						String cityName		= cf.getCityName();
		        	 						out.print("<option value='"+id+"' "+(id.equals(tmpCity) ? "selected='selected'":"")+">"+cityName+"</option>");
		        	 					}
		        	 				}
		        	 			%>
		        	 		</select>
		        	 	</td>
	        		</tr>	
	        	 	<tr>	        	 		
		        	 	<td colspan="2" style="text-align:center;"><input type="submit" value="提交" accesskey="S"/>&nbsp;<input type="button" onclick="javascript:history.go(-1);" value="取消" accesskey="C"/></td>
	        	 	</tr>       	 	
	        	</table>
        	</form>
        <!-- content结束-->
 	</div>
    <!--sideRight结束-->
</div>
<!--wrap结束-->
<%@ include file="/pages/jsp/common/footer.jsp"%>